<?php
// +----------------------------------------------------------------------
// | Copyright (c) 2017 http://www.sycit.cn
// +----------------------------------------------------------------------
// | Author: Peter.Zhang  <hyzwd@outlook.com>
// +----------------------------------------------------------------------
// | Date:   2017/8/26
// +----------------------------------------------------------------------
// | Title:  Customers.php
// +----------------------------------------------------------------------
namespace app\index\model;

use think\Model;

class Customers extends Model
{
    protected function initialize ()
    {
        parent ::initialize (); // TODO: Change the autogenerated stub
    }
    protected $autoWriteTimestamp = true; // 开启自动写入时间戳字段

    //获取客户类型
//    public function getCusTyIdAttr ($value) {
//        $type = new CustomersType();
//        $ty_id = $type::get($value);
//        return $ty_id;
//    }
//
//    //获取客户评估等级
//    public function getCusEvaIdAttr ($value) {
//        $evaluate = new CustomersEvaluate();
//        $result = $evaluate::get($value);
//        return $result;
//    }
//
//    //企业性质
//    public function getCusPropertyAttr($value) {
//        $result = [
//            1=>'私营',
//            2=>'集体',
//            3=>'三资',
//            4=>'国有',
//        ];
//        return $result[$value];
//    }
    //获取物流信息
    public function getCusLogIdAttr($value) {
        $model = new Logistics();
        $result = $model::get($value);
        return  $result;
    }
}